<?php
class mysqlresult {
	private $link_identifier;
	private $result;
	public function __construct ($link_identifier, $result) {
		$this->link_identifier = $link_identifier;
		$this->result = $result;
	}

	//int mysql_affected_rows ([ resource $link_identifier ] )
	public function affected_rows () {
		return mysql_affected_rows ($this->link_identifier);
	}

	//bool mysql_data_seek ( resource $result , int $row_number )
	public function data_seek ($row_number) {
		return mysql_data_seek ($this->result, $row_number);
	}

	//string mysql_db_name ( resource $result , int $row [, mixed $field ] )
	public function db_name ($row, $field = null) {
		if ($field == null) {
			return mysql_db_name ($this->result, $row);
		} else {
			return mysql_db_name ($this->result, $row, $field);
		}
	}

	//array mysql_fetch_array ( resource $result [, int $ result_type ] )
	public function fetch_array ($result_type = MYSQL_ASSOC) {
		return mysql_fetch_array ($this->result, $result_type);
	}

	//array mysql_fetch_assoc ( resource $result )
	public function fetch_assoc () {
		return mysql_fetch_assoc ($this->result);
	}

	//object mysql_fetch_field ( resource $result [, int $field_offset ] )
	public function fetch_field ($field_offset = 0) {
		return mysql_fetch_field ($this->result, $field_offset);
	}

	//array mysql_fetch_lengths ( resource $result )
	public function fetch_lengths () {
		return mysql_fetch_lengths ($this->result);
	}

	//object mysql_fetch_object ( resource $result )
	public function fetch_object () {
		return mysql_fetch_object ($this->result);
	}

	//array mysql_fetch_row ( resource $result )
	public function fetch_row () {
		return mysql_fetch_row ($this->result);
	}

	//string mysql_field_flags ( resource $result , int $field_offset )
	public function field_flags ($field_offset) {
		return mysql_field_flags ($this->result, $field_offset);
	}

	//int mysql_field_len ( resource $result , int $field_offset )
	public function field_len ($field_offset) {
		return mysql_field_len ($this->result, $field_offset);
	}

	//string mysql_field_name ( resource $result , int $field_index )
	public function field_name ($field_index) {
		return mysql_field_name ($this->result, $field_index);
	}

	//int mysql_field_seek ( resource $result , int $field_offset )
	public function field_seek ($field_offset) {
		return mysql_field_seek ($this->result, $field_offset);
	}

	//string mysql_field_table ( resource $result , int $field_offset )
	public function field_table ($field_offset) {
		return mysql_field_table ($this->result, $field_offset);
	}

	//string mysql_field_type ( resource $result , int $field_offset )
	public function field_type ($field_offset) {
		return mysql_field_type ($this->result, $field_offset);
	}

	//bool mysql_free_result ( resource $result )
	public function free_result () {
		if (is_resource($this->result)) {
			return mysql_free_result ($this->result);
		} else {
			return;
		}
	}

	//int mysql_num_fields ( resource $result )
	public function num_fields () {
		return mysql_num_fields ($this->result);
	}

	//int mysql_num_rows ( resource $result )
	public function num_rows () {
		return mysql_num_rows ($this->result);
	}

	//mixed mysql_result ( resource $result , int $row [, mixed $field ] )
	public function result ($row, $field = null) {
		if ($field == null) {
			return mysql_result ($this->result, $row);
		} else {
			return mysql_result ($this->result, $row, $field);
		}
	}

	//string mysql_tablename ( resource $result , int $i )
	public function tablename ($i) {
		return mysql_tablename ($this->result, $i);
	}
}
?>